﻿
@{
    ViewData["Title"] = "大屏显示";
    Layout = "~/Views/Shared/_Layout_Content.cshtml";
}
@section styles
    {
    <link href="~/css/plugins/jqgrid/ui.jqgrid.css" rel="stylesheet" />
    <link href="~/js/plugins/select2/css/select2.css" rel="stylesheet" />
    <environment names="Staging,Production">
        <link rel="stylesheet" href="~/css/grid.min.css" asp-append-version="true" />
    </environment>
}
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>
                
            </h5>
            <div class="ibox-tools">
                <a class="collapse-link">
                    <i class="fa fa-chevron-up"></i>
                </a>
            </div>
        </div>



        <div class="ibox-content">
            <div class="row">
                <div class="col-md-6">
                    <div id="jqGrid_Table0">

                    </div>
                </div>
                <div class="col-md-6">
                    <div id="jqGrid_Table1">

                    </div>
                </div>
                <div class="col-md-6">
                    <div id="jqGrid_Table2">

                    </div>
                </div>
                <div class="col-md-6">
                    <div id="jqGrid_Table3">
                    </div>
                </div>
            </div>

        </div>

    </div>
</div>
@section scripts
    {
    <script src="~/js/plugins/jqgrid/jquery.jqGrid.js"></script>
    <script src="~/js/plugins/jqgrid/i18n/grid.locale-cn.js"></script>
    <script src="~/js/jqgrid-list.js"></script>
    <script src="~/js/json2.js"></script>
    <script src="~/js/base.js"></script>
    <script src="~/js/plugins/select2/js/select2.js"></script>
    <script src="~/js/BindSelect.js"></script>
    <environment names="Staging,Production">
        <script src="~/js/grid.min.js" asp-append-version="true"></script>

    </environment>




    <script>
        function GetSouce(reportType) {
              $.ajax({
                url: '@Url.Action("../Statistics/GetListWithPager")',
                type: "GET",
                dataType: "json",
                async: true,
                data: {
                    orginationName: "",
                    reportType: reportType,
                    status: 0,
                },
                success: function (data) {
                    var table = ('<table class="ui-jqgrid-htable ui-common-table table table-bordered"');
                    table += '<tr class="ui-jqgrid-labels" role="row">';
                    table += '<td role="columnheader" class="ui-th-column ui-th-ltr"> 机构名称</td>';
                    //for (var i = 0; i < data.rows.length; i++) {
                        $.each(data.rows[0].employers, function (key, value) {
                            table += '<td role="columnheader" class="ui-th-column ui-th-ltr"> ' + key + '</td>';
                        });
                    //}
                    table += '<td role="columnheader" class="ui-th-column ui-th-ltr"> 状态</td>';
                    table += '</tr>';
                    for (var i = 0; i < data.rows.length; i++) {
                        table += '<tr class="ui-jqgrid-labels" role="row">';
                        table += '<td role="columnheader" class="ui-th-column ui-th-ltr"> ' + data.rows[i].organizationName +'</td>';
                        $.each(data.rows[i].employers, function (key, value) {
                            table += '<td role="columnheader" class="ui-th-column ui-th-ltr"> ' + value + '</td>';
                        });
                        table += '<td role="columnheader" class="ui-th-column ui-th-ltr"> ' + data.rows[i].state + '</td>';
                        table +='</tr>';
                    }
                    table += '</table>';
                    //alert(table)
                    $("#jqGrid_Table" + reportType).append(table);
                }
            });
        }

        $(document).ready(function () {
            GetSouce(0);
            GetSouce(1);
            GetSouce(2);


             $.ajax({
                url: '@Url.Action("../Statistics/GetGroupWorker")',
                type: "GET",
                dataType: "json",
                async: true,
                data: {
                    orginationName: "",
                    reportType: 0,
                    status: 0,
                },
                success: function (data) {
                    var table = ('<table class="ui-jqgrid-htable ui-common-table table table-bordered"');
                    table += '<tr class="ui-jqgrid-labels" role="row">';
                    table += '<td role="columnheader" class="ui-th-column ui-th-ltr"> 机构名称</td>';
             
                    table += '<td role="columnheader" class="ui-th-column ui-th-ltr"> 人数</td>';
                    
                    table += '<td role="columnheader" class="ui-th-column ui-th-ltr"> 状态</td>';
                    table += '</tr>';
                    for (var i = 0; i < data.rows.length; i++) {
                        table += '<tr class="ui-jqgrid-labels" role="row">';
                        table += '<td role="columnheader" class="ui-th-column ui-th-ltr"> ' + data.rows[i].organizationName +'</td>';
                       
                        table += '<td role="columnheader" class="ui-th-column ui-th-ltr"> ' + data.rows[i].workerCount  + '</td>';
                      
                        table += '<td role="columnheader" class="ui-th-column ui-th-ltr"> ' + data.rows[i].state + '</td>';
                        table +='</tr>';
                    }
                    table += '</table>';
                    //alert(table)
                    $("#jqGrid_Table3").append(table);
                }
            });

        });
       
        
    </script>
}